<template>
	<!-- 添加弹框 -->
	<el-dialog title="" visible :show-close="false" :modal-append-to-body="false"  class="wrap">
		<i class="el-icon-close close" @click="cancel" style="color: white;z-index: 99;"></i>
	    <div class="bt">修改考勤</div>
	    <el-form label-width="100px" class="form">
 			<span>确定要更改&nbsp;<span style="color: red;">{{this.zwm}}</span>&nbsp;学生的考勤状态吗？</span><br />
		  <el-radio-group v-model="kqzt" style='font-size: 20px;margin-bottom: 20px;margin-top: 20px;'>
				    <el-radio :label="1">出勤</el-radio>
				    <el-radio :label="2">缺勤</el-radio>
				    <el-radio :label="3">迟到</el-radio>
          </el-radio-group>
		</el-form>
        <div style="text-align: center;">
		<el-button type="primary" class="submit"  @click="submit">修改</el-button>
		<el-button type="danger" class="submit" @click="cancel">退出</el-button>
		</div>
	</el-dialog>
</template>
<script type="text/javascript">
	import qs from 'qs'
	export default {
		props: ['params'],
		data() {
			return {
				kqzt:'',
				zwm:'',
			}
		},
		created() {
//			console.log(this.params,'llllllllllllll')
			this.kqzt=this.params.row.cqzt*1
			this.zwm=this.params.row.zwm
		},
		methods: {
			submit() {
//				if(!this.kqzt) {
//					this.$message.warning('请填写中文名');
//					this.$store.state.loading = false;
//					return;
//				}
				//检测
				this.$store.state.loading = true;
				var logininfo = JSON.parse(localStorage.logininfo);
				var params3 = qs.stringify({
					    xsid:this.params.row.xsid+'',
						day:this.params.row.day+'',
						kqzt:this.kqzt,
						lsid:logininfo.id+'',
						lstype:1,
						bjid:this.params.row.bjid+'',
	                    yhid: logininfo.id+'',
						xxid: logininfo.xxid+''
						
				});
				//执行
				this.axios.post(this.$store.state.api + 'kqjl/updatekq1', params3)
					.then(res => {
						if(res.data.code == 1) {
							this.$emit('close', { type: 'kqzt', cancel: false });
							this.$message.success(res.data.msg);
							this.$store.state.loading = false;
						} else {
							this.$message.warning(res.data.msg);
						}
					}).catch(res => {
						this.$message.error("服务器繁忙，请重试");
						this.$store.state.loading = false;
					})
			},
			cancel() {
				this.$emit('close', { type: 'kqzt', cancel: true })
			}
		}
	}
</script>
<style lang="less" scoped>
	.wrap {
		.el-dialog--small{
			width: 200px;
		}
		.bt{
			position: absolute;
			width: 100%;
			height: 50px;
			margin: 0 auto;
			top:0;
			left:0;
			background: #50BFFF;
			margin-bottom: 20px;
			color:white;
			text-align:left;
			line-height: 50px;
			font-size: 17px;
			padding-left: 15px;
		}
	     .select-block {
 		display: block;
 			width: 85%;
 	}
	.form {
		text-align: center;
		margin-top:20px;

	}
	.input {
		display: inline-block;
		}
		.input-block {
			margin-bottom: 20px;
			text-align: center;
			.input {
				width: 180px;
				display: inline-block;
			}

		}
	     .select-block {
 		display: block;
 			width: 85%;
 	}
	.form {
		text-align: center;
		font-size: 20px;
		margin-top:20px;

	}
	.input {
		display: inline-block;

			}
		.submit {
			width: 120px;
		}

	}
	.input1{
		    width: 300px;
			height: 30px;
			text-align: left;
			/*outline: none;*/
			border: 1px solid #CCCCCC;
			background: none;
			border-radius: 5px;
			// margin-left: 20%;
			text-align: center;
	}
	input::-webkit-outer-spin-button,
	input::-webkit-inner-spin-button{
   -webkit-appearance: none !important;
    }
    input[type="number"]{-moz-appearance:textfield;}
</style>
